/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class EmptyFolder
/*    */   extends RedoableOp
/*    */ {
/*    */   private int mId;
/*    */   private boolean mSubfolders;
/*    */   
/*    */   public EmptyFolder()
/*    */   {
/* 38 */     super(MailboxOperation.EmptyFolder);
/* 39 */     this.mId = 0;
/* 40 */     this.mSubfolders = false;
/*    */   }
/*    */   
/*    */   public EmptyFolder(int mailboxId, int id, boolean subfolders) {
/* 44 */     this();
/* 45 */     setMailboxId(mailboxId);
/* 46 */     this.mId = id;
/* 47 */     this.mSubfolders = subfolders;
/*    */   }
/*    */   
/*    */   protected String getPrintableData() {
/* 51 */     StringBuffer sb = new StringBuffer("id=");
/* 52 */     sb.append(this.mId).append(", subfolders=").append(this.mSubfolders);
/* 53 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 57 */     out.writeInt(this.mId);
/* 58 */     out.writeBoolean(this.mSubfolders);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 62 */     this.mId = in.readInt();
/* 63 */     this.mSubfolders = in.readBoolean();
/*    */   }
/*    */   
/*    */   public boolean isDeleteOp() {
/* 67 */     return true;
/*    */   }
/*    */   
/*    */   public void redo() throws Exception {
/* 71 */     Mailbox mbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/* 72 */     mbox.emptyFolder(getOperationContext(), this.mId, this.mSubfolders);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/EmptyFolder.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */